﻿@{
  
    Layout = "~/Areas/Shared/_spEdit.cshtml";
}

@model Kaiser.Modules.CMS.Models.CategoryInput
<script type="text/javascript"   src="@Url.Content("~/Scripts/ueditor/editor_config.js")"></script>
<script type="text/javascript"  src="@Url.Content("~/Scripts/ueditor/editor_all_min.js")"></script>
<script type="text/javascript">
    window.UEDITOR_CONFIG.toolbars =
    [
        ['fullscreen', 'source', '|', 'undo', 'redo', '|',
            'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', '|',
            'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
            'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
            'directionalityltr', 'directionalityrtl', 'indent', '|',
            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
            'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter'
        ]
    ];
    window.UEDITOR_CONFIG.initialFrameHeight = 150;
</script>
<form method="post" id="Form1">
    <table>
        <tr>
            <td style="width: 11%">父栏目： </td>
            <td>
                @ViewData["parentName"]
                @Html.HiddenFor(m => Model.ParentId)
                @Html.HiddenFor(m => Model.Id)
            </td>
        </tr>
        <tr>
            <td>栏目标识：
            </td>
            <td>
                @Html.TextBoxFor(m => Model.CategoryCode, new {  @style="width:100%" })
            </td>
        </tr>
        <tr>
            <td>栏目名称：
            </td>
            <td>
                @Html.TextBoxFor(m => Model.CategoryName, new { @Class = "easyui-validatebox", @required = "true",@style="width:100%"  })
            </td>
        </tr>

        <tr>
               <td  >栏目URL：
               </td>
            <td>
                @Html.TextBoxFor(m => Model.CategoryUrl,new {@style="width:100%"})
            </td>
        </tr>
            <tr>
                <td>栏目描述：
                </td>
                <td>
                    @Html.TextAreaFor(m => Model.CategoryDesc, new { @Class = "editor" })

                </td>
            </tr>

        <tr>
            <td>排序：
            </td>
            <td>
                @Html.TextBoxFor(m => Model.Sequence, new { @Class = "easyui-validatebox", @required = "true", @style = "width: 40px;", @maxlength = "10" })
            </td>
        </tr>
    </table>
</form>
<script>
    $(function () {

        $(".editor").each(function () {

            var obj = $(this);

            var editor = new UE.ui.Editor();

            editor.render(obj.attr('id'));
        });

        dlg_Edit_form_submitEvent = function () {

            var content = UE.getEditor('CategoryDesc').getContent();
            $("#CategoryDesc").val(encodeURIComponent(content));


            return true;
        };
    })
</script>
